const express=require('express')

let app=express()
app.use(express.static('../list'))
const data=require('./mock/data.json')
app.get('/api/data',(req,res)=>{
      res.send({
          code:200,
          data,
      })
})
app.get('/api/detail',(req,res)=>{
    const {dis:{ a:num1,
        b:num2,
        c:num3,
        d:num4}}=req.query
    console.log(dis)
    res.send({
        code:200,
        data:dis
    })
})
// 16、正确发送数据 10:48
app.post('/api/list',(req,res)=>{
      const {a}=req.body;
      res.send({
          code:200,
          data:a
      })
})

app.listen(8080,()=>console.log('峰'))